<template>
    <van-nav-bar
    title="v50登录"
    left-text="返回"
    left-arrow
    @click-left="$router.back()"
  />
  <!-- 表单区域 -->
  <van-form @submit="onSubmit">
    <van-cell-group inset>
      <van-field
        v-model="loginname"
        name="loginname"
        label="用户名"
        placeholder="用户名"
        :rules="[{ required: true, message: '请填写用户名' }]"
      />
      <van-field
        v-model="password"
        type="password"
        name="password"
        label="密码"
        placeholder="密码"
        :rules="[{ required: true, message: '请填写密码' }]"
      />
    </van-cell-group>
    <div style="margin: 16px">
      <van-button round block type="primary" native-type="submit">
        提交
      </van-button>
    </div>
  </van-form>
  <van-cell-group title="去注册">
    <van-cell title="快速注册" is-link to="/regist" />
  </van-cell-group>
</template>

<script setup lang="ts">
import {ref} from "vue"
import type {Ref} from "vue"
interface IUserForm{
    loginname:string;
    password:string;
}
interface IUserLogin{
    code:"200" | "10010" | "10011";
    data:{
        token:string;
        userid:string;
    };
    message:string
}

const loginname:Ref<string>=ref("");
const password:Ref<string>=ref("");
const onSubmit=(values:IUserForm)=>{
    console.log("submit",values)
}
</script>

<style></style>